#ifndef PM_SUMMARY_H_INCLUDED
#define PM_SUMMARY_H_INCLUDED

#include "pm/dbobject.h"
#include "pm/criteria.h"

namespace pm
{

/**
 * \class Summary
 */
struct Summary
{
	db::ID   id_project;
	db::real work_request;
	db::real cost;
	db::real todo;

	Summary();
	Summary(wxSQLite3ResultSet& res);
	
	double estimation() const { return cost() + todo(); }
	double benefit() const { return work_request() - estimation(); }
};

/**
 * \class GetSummaryByProject
 */
struct GetSummaryByProject : public ICriteriaOne<Summary>
{
	db::ID  id_project;
	
	GetSummaryByProject(const db::ID& idProject);
	
	virtual wxSQLite3Statement prepare(wxSQLite3Database& db);
};

} // namespace pm

#endif // PM_SUMMARY_H_INCLUDED
